package org.common.utils.net.netty.http.listener.entity;

import io.netty.channel.ChannelHandlerContext;
import org.common.utils.net.netty.http.listener.HttpListener;

/**
 * channel异常时调用
 * @author zhouzhibing
 * @date 2025/11/24 14:30
 */
public class ChannelExceptionListenerInfo implements ListenerInfo {

    /**
     * 上下文
     */
    private ChannelHandlerContext ctx;
    /**
     * 异常
     */
    private Throwable e;

    public ChannelExceptionListenerInfo(ChannelHandlerContext ctx, Throwable e) {
        this.ctx = ctx;
        this.e = e;
    }

    @Override
    public HttpListener.Key getKey() {
        return HttpListener.Key.CHANNEL_EXCEPTION;
    }

    public ChannelHandlerContext getCtx() {
        return ctx;
    }

    public Throwable getE() {
        return e;
    }
}
